import { _decorator, Component, Node, Sprite, UITransform } from 'cc';
import { Tools } from './Tools';
const { ccclass, property } = _decorator;

@ccclass('GameOver')
export class GameOver extends Component {

    @property(Sprite)
    spr:Sprite = null;
    
    @property(Node)
    icon:Node = null;
    
    start() {

    }


    game_over(cur_progress: number) {
        Tools.updateWidget(this.node);
        
       this.spr.fillRange = cur_progress/100 ;
       this.icon.setPosition(cur_progress/100 * this.spr.node.parent.getComponent(UITransform).contentSize.width ,0)
    }
}


